import BaseScene, { SceneConfig } from '../../components/scenes/BaseScene';
import { BoxGeometry, Mesh, MeshBasicMaterial } from 'three';

export default class BasicScene extends BaseScene {
  constructor(config: SceneConfig) {
    super(config);
    this.addBox();
  }

  private addBox() {
    const { scene } = this;
    const boxGeometry = new BoxGeometry(100, 100, 100);
    const colors = [0xff0000, 0xffff00, 0xffffff, 0x00ff00, 0x00ffff, 0x0000ff];
    const boxMaterial = colors.map((color) => new MeshBasicMaterial({ color }));
    const boxMesh = new Mesh(boxGeometry, boxMaterial);
    scene.add(boxMesh);
  }
}

export const BasicRender = (config: SceneConfig): BasicScene => {
  const renderWater = new BasicScene(config);
  renderWater.run();
  return renderWater;
};
